package app;

import java.sql.SQLException;
import java.util.Scanner;

import dao.DepartamentoDAO;




public class MainDemo {



	public static void main(String[] args) throws SQLException{

		//Gestion ng = new Gestion();
		Scanner scOpt = new Scanner(System.in);
		Scanner scSubOpt = new Scanner(System.in);
		try {
			DepartamentoDAO dao = new DepartamentoDAO();
			dao.openConex();
			System.out.println( "hola " + dao.getLastID());
			dao.closeConex();
		} catch (Exception e) {
			// TODO: handle exception
		}
		int opt;
		int SubOpt;
		do{

			System.out.println("\t\t Menu de Opciones");
			System.out.println("\t 1. Empleados");
			System.out.println("\t 2. Departamento");
			System.out.println("\t 3. Gerencia");
			System.out.println("\t 0. ***SALIR***");

			opt= Integer.parseInt(scOpt.nextLine());
			switch(opt){
			case 1:
				System.out.println("\t\t Menu de Empleados");
				System.out.println("\t 1. Crear ");
				System.out.println("\t 2. Eliminar");
				System.out.println("\t 3. Editar");
				System.out.println("\t 4. Consultar");
				System.out.println("\t 5. Volver");
				SubOpt= scSubOpt.nextInt();


				break;

			case 2:
				System.out.println("\t\t Menu de Departamento");
				System.out.println("\t 1. Crear ");
				System.out.println("\t 2. Eliminar");
				System.out.println("\t 3. Editar");
				System.out.println("\t 4. Consultar");
				System.out.println("\t 5. Volver");
				SubOpt= scSubOpt.nextInt();
					switch (SubOpt) {
					case 1:
						Gestion.newDepartamento();
					break;

					case 2:
						Gestion.deleteDepartamento();
					break;

					case 3:
						Gestion.updateDepartamento();
					break;

					case 4:
						Gestion.getDepartamento();
					break;

					default:
						break;
					}
				break;


			case 3:
				System.out.println("\t\t Menu de Gerencia");
				System.out.println("\t 1. Crear ");
				System.out.println("\t 2. Eliminar");
				System.out.println("\t 3. Editar");
				System.out.println("\t 4. Consultar");
				System.out.println("\t 5. Volver");
				SubOpt= scSubOpt.nextInt();
				switch (SubOpt) {

				case 1:
					Gestion.newGerencia();
					break;

				case 2:
					Gestion.deleteGerencia();
					break;

				case 3:
					Gestion.updateGerencia();
					break;

				case 4:
					Gestion.getGerencia();
					break;


				}

				break;

			}

		//scOpt.reset();
		}while(opt!=0);
		scOpt.close();
		scSubOpt.close();
	}


}
